<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('strators', function (Blueprint $table) {
            $table->id();

            $table->char('strator_account',64)->unique()->nullable()->comment('账号');
            $table->unsignedBigInteger('strator_mobile')->unique()->nullable()->comment('手机号');
            $table->string('strator_email')->unique()->nullable()->comment('邮箱');
            $table->string('strator_password')->nullable()->comment('密码');
            $table->char('strator_nickname',64)->nullable()->comment('昵称');
            $table->string('strator_avatar')->nullable()->comment('头像');
            $table->tinyInteger('is_suspended')->default(0)->comment('是否被禁用：默认0否，1是');
            $table->tinyInteger('is_super')->default(0)->comment('是否超级管理员：默认0否，1是');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `strators` comment '后台管理员表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('strators');
    }
};
